	import hxjson2.JSON;
	import charts.series.Element;
	
	/**
	 * A simple function to inspect the JSON for items
	 * before we build the chart
	 */
	class JsonInspector
	{
		
		public static function has_pie_chart( json:Dynamic ): Bool
		{
			
			var elements:Array<Element> = cast(Reflect.field(json,'elements'),Array<Element>);
			for (e in elements) {
				if (Reflect.field(e, 'type') == 'pie')
					return true;
			}
			return false;
		}
		
		public static function is_radar( json:Dynamic ): Bool
		{
			if (Reflect.hasField(json,'radar_axis'))
				return true;
			return false;
		}
	}
